package main.java.com.blog.service;

import com.blog.dao.InfoMapper;
import com.blog.entity.Info;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Admin on 2017/6/5.
 */
@SuppressWarnings("ALL")
@Service("InfoService")
public class InfoServiceImpl implements InfoService {

    @Autowired
    InfoMapper infoMapper;


    @Override
    public int addInfo(Info info) {
        return infoMapper.insertSelective(info);
    }

    @Override
    public void updateInfo(Info info) {

        infoMapper.updateByName(info);

    }

    @Override
    public Info findByName(String name) {
        return infoMapper.selectByName(name);
    }

    @Override
    public List<Info> findAll() {
        return infoMapper.selectAll();
    }
}
